//
//  LatestNewsViewController.m
//  家校互通
//
//  Created by 李赛 on 15/6/15.
//  Copyright (c) 2015年 姬鑫宇. All rights reserved.
//

#import "LatestNewsViewController.h"
#import "LatestNewsTableViewCell.h"
@interface LatestNewsViewController ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation LatestNewsViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    _contentTableView.delegate=self;
    _contentTableView.dataSource=self;
//    _contentTableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    
    
    
    // Do any additional setup after loading the view.
}
#pragma mark -UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 30;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    LatestNewsTableViewCell *vCell=[tableView dequeueReusableCellWithIdentifier:@"LatestNewsTableViewCell" forIndexPath:indexPath];
    if (indexPath.row%2==0) {
        vCell.backgroundColor=[UIColor clearColor];
    }else
    {
        vCell.backgroundColor=[UIColor whiteColor];
    }
    return vCell;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    return nil;
}
#pragma mark -UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 70;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.001;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.001;
}
// Called after the user changes the selection.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
//    AppDelegate *_appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
//    LatestNewsTableViewCell *vCell=(LatestNewsTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
    
    [tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
